package com.example.lxj.archives.service.impl;

import java.util.List;

import cn.hutool.core.date.DateUtil;
import com.example.lxj.archives.entity.TbCase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.lxj.archives.mapper.TbCaseMapper;
import com.example.lxj.archives.service.ITbCaseService;

/**
 * 案件Service业务层处理
 * 
 * @author lxj
 * @date 2024-10-15
 */
@Service
public class TbCaseServiceImpl implements ITbCaseService 
{
    @Autowired
    private TbCaseMapper tbCaseMapper;

    /**
     * 查询案件
     * 
     * @param caseId 案件主键
     * @return 案件
     */
    @Override
    public TbCase selectTbCaseByCaseId(Long caseId)
    {
        return tbCaseMapper.selectTbCaseByCaseId(caseId);
    }

    /**
     * 查询案件列表
     * 
     * @param tbCase 案件
     * @return 案件
     */
    @Override
    public List<TbCase> selectTbCaseList(TbCase tbCase)
    {
        return tbCaseMapper.selectTbCaseList(tbCase);
    }

    /**
     * 新增案件
     * 
     * @param tbCase 案件
     * @return 结果
     */
    @Override
    public int insertTbCase(TbCase tbCase)
    {
        tbCase.setCreateTime(DateUtil.date());
        return tbCaseMapper.insertTbCase(tbCase);
    }

    /**
     * 修改案件
     * 
     * @param tbCase 案件
     * @return 结果
     */
    @Override
    public int updateTbCase(TbCase tbCase)
    {
        tbCase.setUpdateTime(DateUtil.date());
        return tbCaseMapper.updateTbCase(tbCase);
    }

    /**
     * 批量删除案件
     * 
     * @param caseIds 需要删除的案件主键
     * @return 结果
     */
    @Override
    public int deleteTbCaseByCaseIds(Long[] caseIds)
    {
        return tbCaseMapper.deleteTbCaseByCaseIds(caseIds);
    }

    /**
     * 删除案件信息
     * 
     * @param caseId 案件主键
     * @return 结果
     */
    @Override
    public int deleteTbCaseByCaseId(Long caseId)
    {
        return tbCaseMapper.deleteTbCaseByCaseId(caseId);
    }
}
